<template>
  <div class="pad-20 bgc-default">
    <div class="tab-sticky">
      <el-tabs v-model="type">
        <el-tab-pane label="申请开票审核" name="1"></el-tab-pane>
        <el-tab-pane label="平台代开审核" name="2" v-if="enterpriseConfig.platformGenerationInvoiceFlag === 1"></el-tab-pane>
        <el-tab-pane label="开票内容" name="3"></el-tab-pane>
      </el-tabs>
    </div>
    <div class="bg-color-white mar-t-20">
      <template v-if="type === '1'">
        <div class="min-width-set">
          <invoice-examine :invoiceMethodType='0'></invoice-examine>
        </div>
      </template>
      <template v-if="type === '2'">
        <div class="min-width-set">
          <invoice-examine :invoiceMethodType='1'></invoice-examine>
        </div>
      </template>
      <template v-if="type === '3'">
        <invoice-content></invoice-content>
      </template>
    </div>
  </div>
</template>

<script>
  import invoiceContent from './invoice-content'
  import invoiceExamine from './invoice-examine'
  import {
    getByEnterpriseId
  } from '@/api/user/enterprise'
  export default {
    components: {
      invoiceContent,
      invoiceExamine
    },
    data() {
      return {
        type: '1',
        enterpriseConfig: {
          // 平台代开发票： 0关闭 1开启
          platformGenerationInvoiceFlag: 0
        }
      }
    },
    // 初始化页面
    created() {
      // 获取企业配置
      getByEnterpriseId(this.getEnterpriseId()).then((response) => {
        this.enterpriseConfig = response.data
      })
    }
  }
</script>

<style lang='less' scoped>
  .min-width-set{
    min-width: 1260px;
  }
  .user-avatar {
    width: 68px;
    height: 68px;
    display: block;
    padding: 1px;
    border: #efefef 1px solid;
  }

  .tab-sticky {
    position: sticky;
    top: 0px;
    left: 20px;
    width: calc(100% + 40px);
    background: white;
    z-index: 1000;
    padding-top: 10px;
    padding-left: 17px;
    margin-left: -20px;
    margin-top: -20px;

    /deep/ .el-tabs__header {
      margin: 0;
    }
  }
</style>
